1. Field of the Invention
The present invention relates to a technique for correcting a red-eye effect generated in an image captured by an image capturing apparatus such as a digital camera.
2. Description of the Related Art
Conventionally, there are commercially available image capturing apparatuses such as digital cameras which record and play back still images using, as a recording medium, a memory card having a solid-state memory element.
Conventional cameras which use a silver halide film suffer a red-eye effect in which when the user takes a picture of a person using an electronic flash, the image capturing apparatus records an eye in red. This red-eye effect is a phenomenon in which the electronic flash light that has entered one's pupil reflects the blood vessels of the retina. Especially in a dark place, the red-eye effect is more likely to occur because the pupil of the eye is open. To solve this problem, even the conventional silver halide cameras irradiate the object using a lamp or LED or electronic flash pre-emission before image capture to contract the pupil at the time of image capture, thereby reducing the red-eye effect. However, it is difficult to completely eliminate the red-eye effect because a red-eye reduction effect is small unless the object person intently gazes at the photographer.
Even digital cameras suffer a similar red-eye effect upon electronic-flash image capture. Like the silver halide cameras, the conventional digital cameras take a red-eye reduction measure by irradiating the object with light before image capture, but they cannot completely avoid a red-eye effect upon image capture. Therefore, the user must manually correct the generated red-eye in the captured digital image by using image processing software or the like.
In view of this, there is proposed an image processing apparatus which automatically detects the positions of the face and eye of a person, and, if a red-eye effect occurs, corrects the red-eye automatically or in a semiautomatic manner based on the detected information. For example, there is available a technique for detecting a face by extracting a flesh color region to detect a red-eye within the detected face region (see Japanese Patent Laid-Open. 10-233929).
There is also proposed a camera which detects a face using pattern matching together with an algorithm for comparing the face probability with a face shape model (see Japanese Patent Laid-Open No. 2001-309225).
Unfortunately, it is technically very difficult to automatically detect and correct all portions of faces in the image, which suffer a red-eye effect. For example, when one takes a picture of a plurality of persons, the faces of all members cannot necessarily be detected in a method of correcting a red-eye by detecting a face using pattern matching together with an algorithm for comparing the face probability with a face shape model. That is, this method may fail to detect the face of a person who is looking away, so red-eyes in the faces of some persons that cannot be detected may remain uncorrected, or a method of correcting a red-eye by discriminating a flesh color to specify a face region may lead to unnatural correction when a lip is mistaken for a red-eye. Also, a method of automatically detecting and correcting a red-eye may fail to accurately detect a red-eye region when a red-eye in a corrected image is detected again. A case in which the image records a person who has a red-tinted eyelid edge because his/her blood vessels are seen through will be described as an example. Before red-eye correction, the red-pupil is more recognizable as a red-eye than the eyelid edge, so erroneous detection is less likely to occur. However, since no red-eye exists after red-eye correction, the red-tinted eyelid edge adjacent to the eye is more likely to be recognized as a red-eye than when the red-eye actually exists. This may lead to erroneous correction (correction of a region other than a red-eye) for an image which has already undergone red-eye correction.